﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.CascadingImageTestView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WinRTXamlToolkit.Sample.Views"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:converters="using:WinRTXamlToolkit.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <UserControl.Resources>
        <converters:DoubleToIntConverter
            x:Key="DoubleToIntConverter" />
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition
                Width="250" />
            <ColumnDefinition
                Width="22" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <StackPanel
            Margin="0,0,15,0">
            <TextBlock
                Text="Columns" />
            <Slider
                x:Name="ColumnsSlider"
                Minimum="1"
                Maximum="100"
                StepFrequency="1"
                SmallChange="1"
                Value="12" />
            <TextBlock
                Text="Rows" />
            <Slider
                x:Name="RowsSlider"
                Minimum="1"
                Maximum="50"
                StepFrequency="1"
                SmallChange="1"
                Value="6" />
        </StackPanel>
        <controls:CustomGridSplitter
            Grid.Column="1" />
        <controls:CascadingImageControl
            Grid.Column="2"
            Width="620"
            Height="300"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Columns="{Binding Value, ElementName=ColumnsSlider, Converter={StaticResource DoubleToIntConverter}}"
            Rows="{Binding Value, ElementName=RowsSlider, Converter={StaticResource DoubleToIntConverter}}"
            ColumnDelay="0:0:0.05"
            RowDelay="0:0:0.1"
            TileDuration="0:0:4"
            Tapped="UIElement_OnTapped">
            <controls:CascadingImageControl.ImageSource>
                <BitmapImage
                    UriSource="ms-appx:///Assets/SplashScreen.png"
                    DecodePixelWidth="620"
                    DecodePixelHeight="300" />
            </controls:CascadingImageControl.ImageSource>
        </controls:CascadingImageControl>
    </Grid>
</UserControl>
